package aidansmeaton.airport.structures;

import aidansmeaton.airport.database.DatabaseHelper;
import android.database.Cursor;

import com.google.android.maps.GeoPoint;

public class Airport {
	
	private String iata;
	private String name;
	private String city;
	private String country;
	private GeoPoint exactLocation;
	private int runway;
	private int passengers;
	
	public Airport(Cursor c){
		
		iata = c.getString(DatabaseHelper.AIRPORT_IATA);
		name = c.getString(DatabaseHelper.AIRPORT_NAME);
		city = c.getString(DatabaseHelper.AIRPORT_CITY);
		country = c.getString(DatabaseHelper.AIRPORT_COUNTRY);
		exactLocation = new GeoPoint(c.getInt(DatabaseHelper.AIRPORT_LATITUDE)*10,c.getInt(DatabaseHelper.AIRPORT_LONGITUDE)*10);
		runway = c.getInt(DatabaseHelper.AIRPORT_RUNWAY);
		passengers = c.getInt(DatabaseHelper.AIRPORT_PASSENGERS);
		
	}

	public String getIata() {
		return iata;
	}

	public void setIata(String iata) {
		this.iata = iata;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public GeoPoint getExactLocation() {
		return exactLocation;
	}

	public void setExactLocation(GeoPoint exactLocation) {
		this.exactLocation = exactLocation;
	}

	public int getRunway() {
		return runway;
	}

	public void setRunway(int runway) {
		this.runway = runway;
	}

	public int getPassengers() {
		return passengers;
	}

	public void setPassengers(int passengers) {
		this.passengers = passengers;
	}
	
	
	public String toString(){
		return iata + '\n' + name + '\n' + city + '\n' + country + '\n' + runway + '\n' + passengers;
			
	}
	
}
